import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsNumber, IsOptional, IsString } from 'class-validator';

export class CreateMajorDto {
  @ApiProperty({ example: '1', description: 'id' })
  @IsOptional()
  id?: number;

  @ApiProperty({ example: '1234567', description: '专业名称' })
  @IsString()
  @IsNotEmpty({ groups: ['create'], message: '专业名称' })
  name: string;

  @ApiProperty({ example: '1234567', description: '专业描述' })
  @IsString()
  desc: string;

  @ApiProperty({ example: 1, description: '学院id' })
  @IsNumber()
  @IsNotEmpty({ groups: ['create'], message: '请选择学院' })
  department_id: number;
}
